-- local frame, events = CreateFrame("Frame"), {};
local events = {}
function events.PLAYER_ENTERING_WORLD(...)
	print('entering world')
end

function events.PLAYER_LEAVING_WORLD(...)
	print('leaving world')
end

function events.PLAYER_CONTROL_GAINED(...)
	print('获取控制权')
end

function events.PLAYER_CONTROL_LOST(...)
	print('lost控制权')
end

function events.PLAYER_REGEN_ENABLED(...)
	print('离开战斗')
end

function events.PLAYER_REGEN_DISABLED(...)
	print('进入战斗')
end


function events.UNIT_SPELLCAST_SUCCEEDED(...)
	local caster, spell = ...
	if caster == "player" then
		ut.onSpell(spell)
	end
end
-- SPELL_UPDATE_USABLE
-- PLAYER_LEAVE_COMBAT
F:SetScript("OnEvent", function(frame, event, ...)
	events[event](...)
end)

for k, v in pairs(events) do
	F:RegisterEvent(k)
end
